package com.mzj.saas.mservice.propertybill.repository;

import com.mzj.saas.mservice.propertybill.entity.DepartmentAuditor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface DepartmentAuditorRepository extends PagingAndSortingRepository<DepartmentAuditor, Long>, JpaSpecificationExecutor<DepartmentAuditor>, JpaRepository<DepartmentAuditor, Long> {
    List<DepartmentAuditor> findByDepIdAndType(Long depId , Integer type);

    @Modifying
    @Transactional
    void deleteByIdIn(List<Long> auditorIds);
}
